package cemp.thread;

import cemp.entity.StockAll;
import cemp.entity.StockAvg;
import cemp.mapper.StockAvgMapper;
import cemp.service.FetchDataService;

public class StockAvgTask implements Runnable{

    private FetchDataService fetchDataService;
    private String beginDate;
    private String endDate;
    private String stockCode;

    public StockAvgTask(FetchDataService fetchDataService,String beginDate, String endDate, String stockCode) {
        this.fetchDataService = fetchDataService;
        this.beginDate = beginDate;
        this.endDate = endDate;
        this.stockCode = stockCode;
    }

    @Override
    public void run() {
        System.out.println("run task begin");
        fetchDataService.addAvg2(beginDate,endDate,stockCode);
        System.out.println("run task end");
    }
}
